package com.yufuchang;

import com.yufuchang.entity.Book;
import com.yufuchang.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yufuchang on 2020/8/13.
 */
@RestController
public class ConfigController {

    @GetMapping("/get_config")
    public String getConfig(@ModelAttribute("user") User user,@ModelAttribute("book") Book book){
        return "name：" + user.getName() + " | age：" + user.getAge() + "<br>"
                + "name：" + book.getName() + " | price：" + book.getPrice();
    }
}
